package com.hbpu.encap.collection;

import java.util.HashMap;
import java.util.Map;

public class Homework03 {
    public static void main(String[] args) {
        Map<String, Integer> stringIntegerHashMap = new HashMap<>();
        stringIntegerHashMap.put("jack", 650);
        stringIntegerHashMap.put("tom", 1200);
        stringIntegerHashMap.put("smith", 2900);

        System.out.println(stringIntegerHashMap);

        for (String s : stringIntegerHashMap.keySet()) {
            System.out.println(s + ":" + stringIntegerHashMap.get(s));
        }

        stringIntegerHashMap.put("jack", 2600);
        for (String s : stringIntegerHashMap.keySet()) {
            System.out.println(s + ":" + stringIntegerHashMap.get(s));
        }

        for (String s : stringIntegerHashMap.keySet()) {
            System.out.println(s + ":" + (stringIntegerHashMap.get(s) + 100));
        }

        for (String s : stringIntegerHashMap.keySet()) {
            System.out.println(s);
        }

        for (String s : stringIntegerHashMap.keySet()) {
            System.out.println(stringIntegerHashMap.get(s));
        }


    }
}
